package com.liulishuo.demo.filedownloaderapplication;

import com.liulishuo.filedownloader.FileDownloader;
import com.liulishuo.filedownloader.connection.FileDownloadUrlConnection;
import ohos.aafwk.ability.AbilityPackage;
import ohos.app.AbilityContext;

public class FileDownloaderApplication extends AbilityPackage {
    public static AbilityContext instance;
    @Override
    public void onInitialize() {
        super.onInitialize();
        instance = this;
        //FileDownloader.setupOnApplicationOnCreate(this);
        FileDownloader.setupOnApplicationOnCreate(this)
                .connectionCreator(new FileDownloadUrlConnection
                        .Creator(new FileDownloadUrlConnection.Configuration()
                        .connectTimeout(15_000) // set connection timeout.
                        .readTimeout(15_000) // set read timeout.
                )).commit();
    }
}
